<select class="form-control" name="province_id" id="J_province"></select>
<select class="form-control"  name="city_id" id="J_city" style="display:none;"></select>
<select class="form-control"  name="district_id" id="J_district" style="display:none;"></select>
<script>!window.jQuery && document.write('<script src=\"__COMMON__\jquery-1.10.2.min.js\">'+'</scr'+'ipt>');</script>
<script type="text/javascript">

$(function(){
    var pid = "{$param.province_id|default=''}";  //默认省份id
    var cid ="{$param.city_id|default=''}";   //默认城市id
    var did = "{$param.district_id|default=''}" ; //默认区县市id
    function change_province(pid){
        $.post("{:addon_url('ChinaCity://ChinaCity/getProvinces')}", {pid: pid}, function(result){
            $("#J_province").html(result);
        });
    }

function change_city(p_pid,p_cid){
    $.post('{:addon_url("ChinaCity://ChinaCity/getCitys")}', {pid: p_pid, cid: p_cid}, function(result){
        $("#J_city").show().html(result);
    });

}
function change_district(p_cid,p_did){
    $.post('{:addon_url("ChinaCity://ChinaCity/getDistricts")}', {cid: p_cid, did: p_did}, function(result){
        $("#J_district").show().html(result);
    });
}
    setTimeout(function () {

        change_province(pid);
        cid && change_city(pid,cid);
        did&&  change_district(cid,did);
    }, 600);
	$('#J_province').change(function(){
		var pid_g = $(this).children('option:selected').val();
		change_city(pid_g);
        change_district(0);

	});

	$('#J_city').change(function(){
		var cid_g=$(this).children('option:selected').val();
		change_district(cid_g)


	});

	$('#J_district').change(function(){
		var did_g=$(this).children('option:selected').val();
	});

});
</script>